#include<iostream>
#include<string>
using namespace std;
string s;
int main()
{
	cin >> s;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == '0' || s[i] == '8') {
			cout << "YES" << endl;
			cout << s[i]-'0'<< endl;
			return 0;
		}
	}
	int n = s.size();
	for (int i = 0; i < n - 1; i++) {
		for (int j = i + 1; j < n; j++) {
			int ans = (s[i] - '0') * 10 + (s[j] - '0');
			if (ans % 8 == 0) {
				cout << "YES" << endl;
				cout << ans << endl;
				return 0;
			}
		}
	}
	for (int i = 0; i < n - 2; i++) {
		for (int j = i + 1; j < n - 1; j++) {
			for (int k = j + 1; k < n; k++) {
				int ans = (s[i] - '0') * 100 + (s[j] - '0') * 10 + s[k] - '0';
				if (ans % 8 == 0) {
					cout << "YES" << endl;
					cout << ans << endl;
					return 0;
				}
			}
		}
	}
	cout << "NO" << endl;
	return 0;
}